package com.czk.variabledeployment;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * @Author ChenZhangKun
 * @Date 2020/9/11 14:35
 */
public class VirableDeployment {
    public static void main(String[] args) {
        //
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        //
        RepositoryService repositoryService = processEngine.getRepositoryService();
        // 实现部署
        Deployment deploy = repositoryService.createDeployment()
                .addClasspathResource("diagram/leave.bpmn")
                .addClasspathResource("diagram/leave.png")
                .name("带流程变量的流程部署")
                .deploy();
        // 输出部署信息
        System.out.println("流程部署的id"+deploy.getId());
        System.out.println(deploy.getName());
    }
}
